<template>
  <div class="everyday-sentence sec-card">
    <div class="everyday-sentence-desc section-header">
      🥳 每日一句
    </div>
    <div class="sentence-content">
      {{ tip.content }}
    </div>
    <div class="sen-author">
      ——{{ tip.author }}
    </div>
  </div>
</template>

<script>
import {getTodayTip} from '@/api/tip'
export default {
  name: 'Tip',
  data() {
    return {
      tip: {}
    }
  },
  created() {
    this.fetchTodayTip()
  },
  methods: {
    fetchTodayTip() {
      getTodayTip().then(response => {
        const { data } = response
        this.tip = data
      })
    }
  }
}
</script>

<style scoped>
.sentence-content{
  padding: 14px;
  font-size: 14px;
}
.sen-author{
  padding: 14px;
  display: flex;
  justify-content: flex-end;
  font-size: 14px;
}
</style>
